<template>
  <!-- 统计和清空 -->
  <footer class="footer">
    <!-- 统计 -->
    <span class="todo-count"
      >合 计:{{ list.length }}<strong></strong></span
    >
    <!-- 清空 -->
    <button class="clear-completed" @click="clear">清空任务</button>
  </footer>
</template>

<script>
export default {
 props:{
  list:Array
 },
 methods:{
  clear(){
    // console.log(this.list);
    // this.list.forEach(item=>console.log(item.msg))
    // this.list.forEach(item=>item.msg='')
    this.$emit('clearTask',[])
    // this.list=[]
  }
 }
}
</script>

<style>
</style>
<!-- 父子 -->
<!-- props $emit -->
<!-- 非父子 -->
<!-- provide inject -->